package com.sylli.oeuf.server.object.transferable;

public class StatTO extends BasedTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = -843971967811969715L;
	
	private int statStr;
	
	private int statCon;
	
	private int statVit;
	
	private int statWis;
	
	private int statInt;
	
	private int statChm;
	
	private int statLuk;
	
	private int statDex;
	
	private int statAgi;
	
	private int statHst;
	
	public StatTO() {
		// for flex
	}

	public StatTO(int _str, int _con, int _vit, int _wis, int _int, int _chm, int _luk, int _dex, int _agi, int _hst) {
		statStr = _str;
		statCon = _con;
		statVit = _vit;
		statWis = _wis;
		statInt = _int;
		statChm = _chm;
		statLuk = _luk;
		statDex = _dex;
		statAgi = _agi;
		statHst = _hst;
	}
	
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof StatTO) {
			StatTO s = (StatTO) obj;
			return s.statStr == s.statStr
				&& s.statCon == s.statCon
				&& s.statVit == s.statVit
				&& s.statWis == s.statWis
				&& s.statInt == s.statInt
				&& s.statChm == s.statChm
				&& s.statLuk == s.statLuk
				&& s.statDex == s.statDex
				&& s.statAgi == s.statAgi
				&& s.statHst == s.statHst;
		}
		return false;
	}

	@Override
	public String toString() {
		return "StatTO: statStr=" + statStr
			+ ", statCon=" + statCon
			+ ", statVit=" + statVit
			+ ", statWis=" + statWis
			+ ", statInt=" + statInt
			+ ", statChm=" + statChm
			+ ", statLuk=" + statLuk
			+ ", statDex=" + statDex
			+ ", statAgi=" + statAgi
			+ ", statHst=" + statHst;
	}

	public int getStatStr() {
		return statStr;
	}

	public void setStatStr(int statStr) {
		this.statStr = statStr;
	}
	public int getStatCon() {
		return statCon;
	}

	public void setStatCon(int statCon) {
		this.statCon = statCon;
	}

	public int getStatVit() {
		return statVit;
	}

	public void setStatVit(int statVit) {
		this.statVit = statVit;
	}

	public int getStatWis() {
		return statWis;
	}

	public void setStatWis(int statWis) {
		this.statWis = statWis;
	}

	public int getStatInt() {
		return statInt;
	}

	public void setStatInt(int statInt) {
		this.statInt = statInt;
	}

	public int getStatChm() {
		return statChm;
	}

	public void setStatChm(int statChm) {
		this.statChm = statChm;
	}

	public int getStatLuk() {
		return statLuk;
	}

	public void setStatLuk(int statLuk) {
		this.statLuk = statLuk;
	}

	public int getStatDex() {
		return statDex;
	}

	public void setStatDex(int statDex) {
		this.statDex = statDex;
	}

	public int getStatAgi() {
		return statAgi;
	}

	public void setStatAgi(int statAgi) {
		this.statAgi = statAgi;
	}

	public int getStatHst() {
		return statHst;
	}

	public void setStatHst(int statHst) {
		this.statHst = statHst;
	}
	
	public StatTO sum(StatTO operand) {
		StatTO ret = new StatTO(
				this.statStr + operand.statStr,
				this.statCon + operand.statCon,
				this.statVit + operand.statVit,
				this.statWis + operand.statWis,
				this.statInt + operand.statInt,
				this.statChm + operand.statChm,
				this.statLuk + operand.statLuk,
				this.statDex + operand.statDex,
				this.statAgi + operand.statAgi,
				this.statHst + operand.statHst);
		return ret;
	}
	
	public StatTO subtract(StatTO operand) {
		StatTO ret = new StatTO(
				this.statStr - operand.statStr,
				this.statCon - operand.statCon,
				this.statVit - operand.statVit,
				this.statWis - operand.statWis,
				this.statInt - operand.statInt,
				this.statChm - operand.statChm,
				this.statLuk - operand.statLuk,
				this.statDex - operand.statDex,
				this.statAgi - operand.statAgi,
				this.statHst - operand.statHst);
		return ret;
	}
	
	public int singleValue() {
		return statStr 
			+ statCon
			+ statVit
			+ statWis
			+ statInt
			+ statChm
			+ statLuk
			+ statDex
			+ statAgi
			+ statHst;
	}
}
